home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group99a.txt
/
000098_icon-group-sender _Fri Apr 9 17:25:30 1999.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
1KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA02117
for icon-group-addresses; Fri, 9 Apr 1999 17:24:46 -0700 (MST)
Message-Id: <199904100024.RAA02117@baskerville.CS.Arizona.EDU>
Date: Fri, 9 Apr 1999 15:06:18 -0700 (PDT)
From: Shamim Mohamed <spm@drones.com>
To: icon-group@optima.CS.Arizona.EDU
Subject: 99 Bottles of Beer on the Wall
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
A friend pointed me to a site featuring programs to print out the "99
bottles of beer on the wall" song. I thought the Icon version lacked a
certain je ne sais quois; this is the best I could come up with:
# Look ma, no loops!
procedure main(a)
write(stanza(beer(n := a[1]))) & n = 0
end
procedure beer(n)
n >= 0 | fail
suspend n || " bottle" || (if n ~= 1 then "s" else "") || " of beer" |
beer(n-1)
end
procedure stanza(s)
s[1] ~== "0" | return s || "."
return s || " on the wall.\n\n" || s || " on the wall.\n" || s ||
".\nTake one down, pass it around,"
end
I'm not happy with the way plurals are handled. Anyone else?
-s